<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>后台首页</title>
	</head>
	<body>
		<table width="100%">
			<tr>
				<td>
					<h1>图书管理系统</h1>
				</td>
				<td align="right"></td>
			</tr>
			<tr>
				<td>
				</td>
				<td align="right">
					欢迎<font color="red"> ${admin.userName}</font>回来！ <a href="admin?action=exit">退出</a>
				</td>
			</tr>
		</table>
		<hr size="5" color="blue">
		<table border="1px" align="center" width="50%" cellpadding="5px" cellspacing="0px">
			<caption><h1>图书信息</h1></caption>
			<tr bgcolor="aquamarine">
				<th>图书编号</th>
				<th>图书名称</th>
				<th>图书价格</th>
				<th>图书数量</th>
				<th>作者</th>
				<th>更新时间</th>
				<th>操作 <a href="add.jsp">添加</a></th>
			</tr>
			
			<c:if test="${!empty list}">
			   <c:forEach items="${list}" var="book">
					<tr align="center">
						<td>${book.id}</td>
						<td>${book.name}</td>
						<td>${book.price}</td>
						<td>${book.counts}</td>
						<td>${book.author}</td>
						<td>${book.crtTime}</td>
						<td><a href="book?action=qryByid&id=${book.id}">更新</a> | 
						<a href="book?action=delByid&id=${book.id}">删除</a>
						</td>
					</tr>
				</c:forEach>
			</c:if>
			<c:if test="${empty list}">
	          <tr align="center">
				<td colspan="7"><font color="red">当前没有数据</font></td>
			  </tr>
			</c:if>	
		</table>
		
	</body>
</html>
